<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initRouter()
    {
		$front = Zend_Controller_Front::getInstance();
  		//$front->setBaseUrl('/wroom/public');
		$router = $front->getRouter();
		$router->addRoute(
							'pilotedir',
							new Zend_Controller_Router_Route('pilote/:lettre',
										array(
                                     		'module' => 'default',
											'controller' => 'pilote',
											'action' => 'list'
										),
										array(
											'lettre' => '[a-z,]'
										)));
		$router->addRoute(
							'piloteshow',
							new Zend_Controller_Router_Route('pilote/:id',
										array(
                                     		'module' => 'default',
											'controller' => 'pilote',
											'action' => 'show'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'resultatshow',
							new Zend_Controller_Router_Route('resultat/:id',
										array(
                                     		'module' => 'default',
											'controller' => 'resultat',
											'action' => 'show'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'circuitshow',
							new Zend_Controller_Router_Route('circuit/:id',
										array(
                                     		'module' => 'default',
											'controller' => 'circuit',
											'action' => 'show'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'ecurieshow',
							new Zend_Controller_Router_Route('ecurie/:id',
										array(
                                     		'module' => 'default',
											'controller' => 'ecurie',
											'action' => 'show'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'thumb',
							new Zend_Controller_Router_Route('thumb/:path/:width/:height',
										array(
                                     		'module' => 'default',
											'controller' => 'thumb',
											'action' => 'index'
										),
										array(
											'width' => '[0-9]+',
											'height' => '[0-9]+'
										)));
		$router->addRoute(
							'logout',
							new Zend_Controller_Router_Route('admin/logout',
										array(
                                     		'module' => 'admin',
											'controller' => 'login',
											'action' => 'logout'
										)));
        $router->addRoute(
							'updategrandprix',
							new Zend_Controller_Router_Route('admin/grandprix/update/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'grandprix',
											'action' => 'update'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'deletegrandprix',
							new Zend_Controller_Router_Route('admin/grandprix/delete/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'grandprix',
											'action' => 'delete'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'updatecircuit',
							new Zend_Controller_Router_Route('admin/circuit/update/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'circuit',
											'action' => 'update'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'deletecircuit',
							new Zend_Controller_Router_Route('admin/circuit/delete/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'circuit',
											'action' => 'delete'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'updateecurie',
							new Zend_Controller_Router_Route('admin/ecurie/update/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'ecurie',
											'action' => 'update'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'deleteecurie',
							new Zend_Controller_Router_Route('admin/ecurie/delete/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'ecurie',
											'action' => 'delete'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'updatepilote',
							new Zend_Controller_Router_Route('admin/pilote/update/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'pilote',
											'action' => 'update'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'deletepilote',
							new Zend_Controller_Router_Route('admin/pilote/delete/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'pilote',
											'action' => 'delete'
										),
										array(
											'id' => '[0-9]+'
										)));
		$router->addRoute(
							'addresultat',
							new Zend_Controller_Router_Route('admin/resultat/:id',
										array(
                                     		'module' => 'admin',
											'controller' => 'resultat',
											'action' => 'add'
										),
										array(
											'id' => '[0-9]+'
										)));
		return $router;
	}
}

